{subtemplate viewthread_special_header}

<script type="text/javascript">
<!--{if $optiontype=='checkbox'}-->
	var max_obj = $maxchoices;
	var p = 0;
	function checkbox(obj) {
		if(obj.checked) {
			p++;
			for (var i = 0; i < $('poll').elements.length; i++) {
				var e = $('poll').elements[i];
				if(p == max_obj) {
					if(e.name.match('pollanswers') && !e.checked) {
						e.disabled = true;
					}
				}
			}
		} else {
			p--;
			for (var i = 0; i < $('poll').elements.length; i++) {
				var e = $('poll').elements[i];
				if(e.name.match('pollanswers') && e.disabled) {
					e.disabled = false;
				}
			}
		}
	}
<!--{/if}-->
</script>

<h6>{lang special_poll}</h6>

<!--{if $lastmod['modaction'] || $thread['readperm'] || $thread[itemid] || $lastmod['magicname']}-->
	<ins>
	<!--{if $lastmod['modaction']}-->&nbsp; <a href="misc.php?action=viewthreadmod&amp;tid=$tid" title="{lang thread_mod}" target="_blank">{lang thread_mod_by}</a>&nbsp;<!--{/if}-->
	<!--{if $thread['readperm']}-->&nbsp; {lang readperm_thread} <span class="bold">$thread[readperm]</span> &nbsp;<!--{/if}-->
	<!--{if $lastmod['magicname']}-->&nbsp; <a href="misc.php?action=viewthreadmod&amp;tid=$tid" title="{lang thread_mod}" target="_blank">{lang magics_logs}</a>&nbsp;<!--{/if}-->
	</ins>
<!--{/if}-->

<table summary="" cellspacing="0" cellpadding="0">
	<tr>
		<td class="postcontent">
			<!--{if $thread[remaintime]}-->
				<label>{lang poll_count_down}: <strong>
				<!--{if $thread[remaintime][0]}-->$thread[remaintime][0] {lang poll_day}<!--{/if}-->
				<!--{if $thread[remaintime][1]}-->$thread[remaintime][1] {lang poll_hour}<!--{/if}-->
				$thread[remaintime][2] {lang poll_minute}</strong></label>
			<!--{elseif $expiration && $expirations < $timestamp}--><label>{lang poll_end}</label>
			<!--{/if}-->
			<h1>$thread[subject]</h1>
			<div class="postmessage">
				<!--{if !empty($post[ratings])}--><span class="postratings"><a href="misc.php?action=viewratings&amp;tid=$tid&amp;pid=$post[pid]" title="{lang rate} $post[rate]">$post[ratings]</a></span><!--{/if}-->
				<div id="postmessage_$post[pid]">$post[message]</div>
				<form id="poll" name="poll" method="post" action="misc.php?action=votepoll&fid=$fid&tid=$tid">
					<input type="hidden" name="formhash" value="{FORMHASH}" />

					<div class="box pollpanel">
						<h4>
							<span>{lang poll_yourchoice}
							( <!--{if $multiple}-->{lang poll_multiple}<!--{if $maxchoices}-->: {lang poll_more_than}<!--{/if}--><!--{else}-->{lang poll_single}<!--{/if}--><!--{if $visiblepoll && $allowvote}-->, {lang poll_after_result}<!--{/if}--> )</span>
						<a href="misc.php?action=viewvote&tid=$tid&sid=$sid&page=1" onclick="ajaxget(this.href, 'viewallvoterdiv', 'viewallvoterdiv');doane(event);">{lang poll_voterscount} $voterscount</a>
						&nbsp;</h4>
						<div id="viewallvoterdiv" style="display: none">&nbsp;</div>
						<table summary="poll panel" cellspacing="0" cellpadding="0" style="clear: both;">
							<!--{loop $polloptions $key $option}-->
								<tr>
									<!--{if $allowvote}-->
										<td class="selector"><input class="checkbox" type="$optiontype" name="pollanswers[]" value="$option[polloptionid]" <!--{if $optiontype=='checkbox'}-->onclick='checkbox(this)'<!--{/if}--> /></td>
									<!--{/if}-->
									<td style="width: 20%;">
										{echo $key+1}. &nbsp;$option[polloption]
									</td>
									<td>
										<!--{if !$visiblepoll}-->
											<div class="optionbar">
											<div style="width: $option[width]px;">&nbsp;</div>
											</div>
											<p>$option[votes] ($option[percent]%)</p>
											<!--{if $adminid == 1 && $option[votes] > 0}-->
												<div id="viewvoterframe$option[polloptionid]" style="display:none">&nbsp;</div>
											<!--{/if}-->
										<!--{/if}-->
									</td>
									<td style="width: 120px;">
											<!--{if $adminid == 1 && $option[votes] > 0}-->
												( <a href="misc.php?action=viewvote&tid=$tid&sid=$sid&page=1&polloptionid=$option[polloptionid]" onclick="ajaxget(this.href, 'viewvoterframe$option[polloptionid]', 'viewvoterframe$option[polloptionid]', null, 'auto');doane(event);">{lang poll_show_voter}</a> )
											<!--{/if}-->
									</td>
								</tr>
							<!--{/loop}-->
							<tr>
								<!--{if $allowvote}--><td class="selector">&nbsp;</td><!--{/if}-->
								<td colspan="3">
									<!--{if $allowvote}-->
										<button class="submit" type="submit" name="pollsubmit" id="pollsubmit" value="true">{lang submit}</button>
									<!--{/if}-->
								</td>
							</tr>
						</table>
					</div>
				</form>

				<!--{if $post['attachment']}-->
					<div class="notice postattach">{lang attachment}: <em>{lang attach_nopermission}</em></div>
				<!--{elseif $hideattach[$post[pid]] && $post['attachments']}-->
					<div class="notice postattach">{lang attachment}: <em>{lang attachment_reply_show}</em></div>
				<!--{elseif $postlist[$pid]['attachlist']}-->
					<div class="box postattachlist">
						<h4>{lang attachment}</h4>
						{$postlist[$pid][attachlist]}						</div>
				<!--{/if}-->

				<!--{if $thread['tags'] || $relatedkeywords}-->
					<p class="posttags">{lang thread_keywords}
					<!--{if $thread['tags']}-->$thread[tags]<!--{/if}-->
					<!--{if $relatedkeywords}--><span class="postkeywords">$relatedkeywords</span><!--{/if}-->
					</p>
				<!--{/if}-->

				<!--{if $relatedtagstatus}-->
					<script type="text/javascript" src="tag.php?action=relatetag&rtid=$tid"></script>
				<!--{/if}-->


			</div>
		</td>
		<td class="postauthor">
			$post[avatar]
			<dl>
				<dt>{lang special_author}</dt><dd><a href="space.php?username=$post[author]" target="_blank">$post[author]</a></dd>
				<dt>$post[authortitle]</dt><dd>&nbsp;</dd>
				<dt>{eval showstars($post['stars']);}</dt><dd>&nbsp;</dd>
				<dt>{lang special_starttime}</dt><dd>$thread[starttime]</dd>
			</dl>
		<!--{if $post['msn'] || $post['qq'] || $post['icq'] || $post['yahoo'] || $post['taobao']}-->
		<p class="imicons">
			<!--{if $post['msn']}--><a target='_blank' href='http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=$post[msn]&mkt=zh-cn'><img style='border-style: none;' src='http://messenger.services.live.com/users/$post[msn]/presenceimage?mkt=zh-cn' width='16' height='16' /></a><!--{/if}-->
			<!--{if $post['qq']}--><a href="http://wpa.qq.com/msgrd?V=1&amp;Uin=$post[qq]&amp;Site=$bbname&amp;Menu=yes" target="_blank"><img src="{IMGDIR}/qq.gif" alt="QQ" /></a><!--{/if}-->
			<!--{if $post['icq']}--><a href="http://wwp.icq.com/scripts/search.dll?to=$post[icq]" target="_blank"><img src="{IMGDIR}/icq.gif" alt="ICQ" /></a><!--{/if}-->
			<!--{if $post['yahoo']}--><a href="http://edit.yahoo.com/config/send_webmesg?.target=$post[yahoo]&.src=pg" target="_blank"><img src="{IMGDIR}/yahoo.gif" alt="Yahoo!"  /></a><!--{/if}-->
			<!--{if $post['taobao']}--><script type="text/javascript">document.write('<a target="_blank" href="http://amos1.taobao.com/msg.ww?v=2&uid='+encodeURIComponent('$post[taobaoas]')+'&s=2"><img src="{IMGDIR}/taobao.gif" alt="{lang taobao}" /></a>');</script><!--{/if}-->
		</p>
		<!--{/if}-->
			<!--{if $customauthorinfo[3]}--><dl class="profile">{eval @eval('echo "'.$customauthorinfo[3].'";');}</dl><!--{/if}-->			</td>
	</tr>
	<tr>
		<td class="postcontent">
			<p class="postactions">
				<!--{if $forum['ismoderator'] || $thread[authorid] == $discuz_uid}--><a href="post.php?action=edit&amp;fid=$fid&amp;tid=$tid&amp;pid=$post[pid]&amp;page=$page&amp;extra=$extra">{lang edit}</a>&nbsp;&nbsp;<!--{/if}-->
				<!--{if $raterange && $post['authorid']}-->&nbsp;<a href="misc.php?action=rate&amp;tid=$tid&amp;pid=$post[pid]&amp;page=$page" id="ajax_rate_$post[pid]" onclick="ajaxmenu(event, this.id, 9000000, '', 0)">{lang rate}</a>&nbsp;&nbsp;<!--{/if}-->
				<!--{if $discuz_uid && $magicstatus}--><a href="magic.php?action=user&amp;pid=$post[pid]" target="_blank">{lang magics_use}</a><!--{/if}-->
			</p>
		</td>
		<td class="postauthor">&nbsp;</td>
	</tr>
</table></div>
$tagscript

<!--{if $admode && empty($insenz['hardadstatus']) && !empty($advlist['interthread']) && $thread['replies']}--><div class="ad_column" id="ad_interthread">$advlist[interthread]</div><!--{else}--><div id="ad_interthread"></div><!--{/if}-->

<div id="ajaxspecialpost"></div>
<script type="text/javascript">ajaxget('viewthread.php?fid=$fid&tid=$tid&do=viewspecialpost&page=$page', 'ajaxspecialpost');</script>

{subtemplate viewthread_special_footer}